package com.dp.vo;

import java.io.Serializable;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "news_k16servercity")
public class NewsK16serverCity implements Serializable {
	    private static final long serialVersionUID = 1L;
	    
	    @EmbeddedId
	    protected NewsK16serverCityPK k16serverCityPK;
	    @JoinColumn(name = "serverid", referencedColumnName = "id")   
		@ManyToOne
	    private NewsK16server k16server;
	    
	    public NewsK16serverCity(){
	    	
	    }
	    public NewsK16serverCity(Integer areaid,String softagent){
	    	this.k16serverCityPK=new NewsK16serverCityPK(areaid,softagent);
	    }
	    
		public NewsK16serverCityPK getK16serverCityPK() {
			return k16serverCityPK;
		}
		public void setK16serverCityPK(NewsK16serverCityPK cityPK) {
			k16serverCityPK = cityPK;
		}
		public NewsK16server getK16server() {
			return k16server;
		}
		public void setK16server(NewsK16server k16server) {
			this.k16server = k16server;
		}
		
		@Override
	    public int hashCode() {
	        int hash = 0;
	        hash += (k16serverCityPK != null ? k16serverCityPK.hashCode() : 0);
	        return hash;
	    }

	    @Override
	    public boolean equals(Object object) {
	        if (!(object instanceof NewsK16serverCity)) {
	            return false;
	        }
	        NewsK16serverCity other = (NewsK16serverCity) object;
	        if ((this.k16serverCityPK == null && other.k16serverCityPK != null) || (this.k16serverCityPK != null && !this.k16serverCityPK.equals(other.k16serverCityPK))) {
	            return false;
	        }
	        return true;
	    }

	    @Override
	    public String toString() {
	        return "com.dp.vo.NewsK16serverCity[k16serverCityPK=" + k16serverCityPK + "]";
	    }
}
